package com.supostacks.domain.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.supostacks.domain.repository.IUserRepository;
import com.supostacks.domain.service.IUserService;
import com.supostacks.domain.vo.UserVo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserServiceImpl implements IUserService {
    @Resource
    private IUserRepository userInfoRepository;

    @Override
    public String insert(UserVo userVo) {
        return userInfoRepository.insert(userVo);
    }

    @Override
    public void deleteById(String id) {
        userInfoRepository.deleteById(id);
    }

    @Override
    public String updateById(UserVo userVo) {
        return userInfoRepository.updateById(userVo);
    }

    @Override
    public UserVo selectById(String id) {
        return userInfoRepository.selectById(id);
    }

    @Override
    public List<UserVo> selectList(JSONObject param) {
        return userInfoRepository.selectList(param);
    }

    @Override
    public JSONObject selectByPage(JSONObject param,int pageNo,int pageSize) {
        return userInfoRepository.selectByPage(param,param.getInteger("pageNo"),param.getInteger("pageSize"));
    }

}
